export default function (data, footString) {
    console.log(footString)
    let imgarr = [
        [
            "/Direct/com.nebutown.workflow.root.Root/commonui/assets/sharp4@2x.png",
            "/Direct/com.nebutown.workflow.root.Root/commonui/assets/square3@2x.png",
            "/Direct/com.nebutown.workflow.root.Root/commonui/assets/mine@2x.png"],
        ["/Direct/com.nebutown.workflow.root.Root/commonui/assets/startflow@2x.png",
            "/Direct/com.nebutown.workflow.root.Root/commonui/assets/diagram@2x.png",
            "/Direct/com.nebutown.workflow.root.Root/commonui/assets/mine2@2x.png"]
    ]
    let style = `
                <style>
                    .commonFooter{
                        width: 100%;  
                        display: flex;
                        height: 90%;
                        justify-content: space-around;     
                        margin-top: 0.167rem;                  
                    }
                    .commonFooterItem{
                        width: 25%;
                        height: 100%;
                        text-align: center;
                        font-size: 0.16rem;
                        color: #999;
                    }
                    .commonFooterItem img{
                        margin: 0 auto;
                        display: block;
                        width: 0.667rem;
                        height: 0.667rem;
                    }
                    .active{
                        color:#008be6
                    }
                </style>
                `;
    let footerString = '';
    data.forEach((item, i) => {
        footerString += `<div class="commonFooterItem" path="${item.path}"><img src=${item.itemName === footString ? imgarr[0][i] : imgarr[1][i]} alt=""><span class="${item.itemName === footString ? 'active' : ''}">${item.displayName}</span></div>`
    })
    let html = `
                <div class="commonFooter">
                    ${footerString}
                </div>
               `
    window.nbasics.differAction(() => {

        let commonFooterItem = document.querySelectorAll(".commonFooterItem");
        commonFooterItem.forEach((item, i) => {
            item.onclick = function () {

                window.nbasics.touchBack({"path": item.getAttribute("path"), data: JSON.stringify({})})
            }
        })
    });
    return (`<div style="width: 100%;background: #F9F9F9;overflow: hidden; bottom: 0;height: 8%;border-top: 0.013rem solid #c3c3c3;position: fixed">${style}${html}</div>`);
}